package com.shujia.interface_.exer;

public class Teacher {

    /*
    接口是一组行为的抽象, 就是一组功能的抽象
    has-a 组合
    接口组合成类的属性
     */
    private IDailup dailup;

    private IPlay play;

    private ITakePhoto takePhoto;

    private IMobile mobile;

    public void dailup() {
        System.out.println("teacher dailup start...");
        dailup.dailup();
        System.out.println("teacher dailup end...");
    }

    public void play() {
        System.out.println("teacher play start...");
        play.play();
        System.out.println("teacher play end...");
    }

    public void takePhoto() {
        System.out.println("teacher takePhoto start...");
        takePhoto.takePhoto();
        System.out.println("teacher takePhoto end...");
    }

    public void mobile() {
        System.out.println("teacher mobile start...");
        mobile.dailup();
        mobile.play();
        mobile.takePhoto();
        System.out.println("teacher mobile end...");
    }


    public IDailup getDailup() {
        return dailup;
    }

    public void setDailup(IDailup dailup) {
        this.dailup = dailup;
    }

    public IPlay getPlay() {
        return play;
    }

    public void setPlay(IPlay play) {
        this.play = play;
    }

    public ITakePhoto getTakePhoto() {
        return takePhoto;
    }

    public void setTakePhoto(ITakePhoto takePhoto) {
        this.takePhoto = takePhoto;
    }

    public IMobile getMobile() {
        return mobile;
    }

    public void setMobile(IMobile mobile) {
        this.mobile = mobile;
    }
}
